package com.wx.day05.Annotation_aop.test2.Work.Service;

import com.wx.day05.Annotation_aop.test2.Work.Dao.StudentDao;
import com.wx.day05.Annotation_aop.test2.Work.Service.StudentService;
import com.wx.day05.Annotation_aop.test2.Work.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceimpl implements StudentService {
    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> getStudentList() throws Exception {
        return studentDao.queryAll();
    }

    @Override
    public void updateStudent(Integer id) throws Exception {
        studentDao.updateDateById(id);
    }

    @Override
    public void addStudent() throws Exception {
        studentDao.insertData();
    }

    @Override
    public void deleteStudent(Integer id) throws Exception {
        studentDao.deleteById(id);
    }
}
